package indoor.nexd.com.nexdmap.routeplan;
import java.io.IOException;
import java.util.List;
//
//This program tries to find the nearest edge from point p, and the point q on the edge which is nearest to p.
//Then add q to the vertex list.
public class Call_Main {
    public static void main(String[] args) throws IOException
    {
        String file_path = "/Users/hyk/Documents/workspace/dk_co/src/RoadNet1.json";
//        String file_path = "C:/workspace/dk/sample_json_connect.json";
//        String poi_path = "C:/workspace/dk/HRWCC_F1_F2.json";
        Dijkstra dj = new Dijkstra();
//        dj.get_path_unit_test(file_path);
        dj.load_config(file_path);
//        long source_ind = 1010011700030011L;
//        double p[]={88,109};
        double p[]={103.5,124.4};
        long floorId=101080550001L;
        long target_ind = 1010805500041119L;
        List<Vertex> pathList= dj.get_path_poi(p, target_ind, floorId);
        for(Vertex l:pathList){
        	System.out.println(l.name+" "+l.location[0]+" "+l.location[1]);
        }
        
        List<SearchPoiShowBean> poiList=dj.searchPoi(p,floorId,1020);
        
        System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
        
        
        for(SearchPoiShowBean l:poiList){
        	System.out.print(l.getPoiId()+" ");
        	System.out.print(l.getCurrentX()+" ");
        	System.out.println(l.getCurrentY());
        }
        
        System.out.println("==================================================================================");
    }
}
